using System.Collections.Generic;
using UnityEngine;

public enum BuildingType
{
    None,
    Tree,
    BushTree,
    OakTree
}
public struct BlockAndPos
{
    public Vector3 localPos;
    public BlockType blockType;
}
public class Buildings
{
    public static BlockAndPos[] GetBuildingData(BuildingType buildingType)
    {
        return BuildingsList[(int)buildingType];
    }

    
    static readonly BlockAndPos[] None = new BlockAndPos[]{
        new BlockAndPos
        {
            localPos = new Vector3(0,0,0),
            blockType = BlockType.Air,
        },
    };

    static readonly BlockAndPos[] Tree = new BlockAndPos[]
    {
        new BlockAndPos
        {
            localPos = new Vector3(0,0,0),
            blockType = BlockType.Log,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,1,0),
            blockType = BlockType.Log,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,2,0),
            blockType = BlockType.Log,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,0),
            blockType = BlockType.Log,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,2),
            blockType = BlockType.Leave,
        },


        new BlockAndPos
        {
            localPos = new Vector3(-1,4,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,4,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,4,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,2),
            blockType = BlockType.Leave,
        },


        new BlockAndPos
        {
            localPos = new Vector3(-1,5,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,5,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,5,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,5,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,5,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,5,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,5,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,5,1),
            blockType = BlockType.Leave,
        },

        new BlockAndPos
        {
            localPos = new Vector3(-1,6,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,6,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,6,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,6,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,6,1),
            blockType = BlockType.Leave,
        },
    };

    static readonly BlockAndPos[] BushTree = new BlockAndPos[]
    {
        new BlockAndPos
        {
            localPos = new Vector3(0,0,0),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,0,0),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,0,0),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,0,1),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,0,-1),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,1,0),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,2,0),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,0),
            blockType = BlockType.OakLog,
        },
    };

    static readonly BlockAndPos[] OakTree = new BlockAndPos[]
    {
        new BlockAndPos
        {
            localPos = new Vector3(0,0,0),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,1,0),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,2,0),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,0),
            blockType = BlockType.OakLog,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,3,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,3,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,3,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,3,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,3,2),
            blockType = BlockType.Leave,
        },


        new BlockAndPos
        {
            localPos = new Vector3(-1,4,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,4,-2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,4,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,4,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-2,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(2,4,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,4,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,4,2),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,4,2),
            blockType = BlockType.Leave,
        },


        new BlockAndPos
        {
            localPos = new Vector3(-1,5,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,5,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(-1,5,1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,5,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,5,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,5,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,5,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,5,1),
            blockType = BlockType.Leave,
        },

        new BlockAndPos
        {
            localPos = new Vector3(-1,6,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(1,6,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,6,0),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,6,-1),
            blockType = BlockType.Leave,
        },
        new BlockAndPos
        {
            localPos = new Vector3(0,6,1),
            blockType = BlockType.Leave,
        },
    };

    static readonly List<BlockAndPos[]> BuildingsList = new List<BlockAndPos[]>()
    {
        None,Tree,BushTree,OakTree
    };
}
